import 'package:childrenapp/details.dart';
import 'package:flutter/material.dart';

class kp extends StatelessWidget {
  const kp({
    super.key,
    required this.images,
    required this.text,
    required this.money,
    this.collect = 'images/Icon/Heart.png',
  });

  final String images;
  final String text;
  final String money;
  final String collect;

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: () {
        Navigator.push(context, MaterialPageRoute(builder: (context) {
          return Details();
        }));
      },
      child: Column(
        children: [
          Stack(children: [
            Container(
              margin: EdgeInsets.only(top: 20),
              width: (MediaQuery.of(context).size.width - 60) / 2,
              height: 300,
              decoration: BoxDecoration(
                  // color: Colors.pink[200],
                  borderRadius: BorderRadius.circular(20)),
              child: Image.asset(
                images,
                fit: BoxFit.fill,
              ),
            ),
            Positioned(
              bottom: 0,
              child: Container(
                width: (MediaQuery.of(context).size.width - 60) / 2,
                height: 70,
                decoration: BoxDecoration(
                  color: Color.fromRGBO(243, 240, 235, 1.0),
                  borderRadius: BorderRadius.only(
                    bottomLeft: Radius.circular(20),
                    bottomRight: Radius.circular(20),
                  ),
                ),
                child: Column(
                  mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                  children: [
                    Container(
                      alignment: Alignment.centerLeft,
                      margin: EdgeInsets.only(left: 15),
                      // margin: EdgeInsets.only(top: 10),
                      child: Text(
                        text,
                        style: TextStyle(fontSize: 16),
                      ),
                    ),
                    Container(
                      child: Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          Container(
                            margin: EdgeInsets.only(
                              left: 15,
                            ),
                            child: Text(
                              money,
                              style: TextStyle(
                                  fontSize: 20, fontWeight: FontWeight.w600),
                            ),
                          ),
                          Container(
                            margin: EdgeInsets.only(right: 14),
                            child: Image(
                              image:
                                  AssetImage('images/Icon/Arrow - Right 3.png'),
                              width: 25,
                              height: 25,
                            ),
                          )
                        ],
                      ),
                    ),
                  ],
                ),
              ),
            ),
            Positioned(
              top: 40,
              right: 18,
              child: Container(
                child: Image(
                  image: AssetImage(collect),
                  height: 25,
                  width: 25,
                ),
              ),
            )
          ]),
        ],
      ),
    );
  }
}
